<template>
  <div class="statisticsDetail">
    <zyInfoPanel title="收件详情" :showUnfoldButton="false">
      <div class="lookDetail">
        <zyInfoPanelDetail :info="statisticsInfo" cellNum="4"></zyInfoPanelDetail>
        <div class="imgArea">
          <div class="imgTitle">面单照片：</div>
          <div class="imgContent">
            <zy-image v-model="pictures_urls" class="img" v-if="pictures_urls" readonly></zy-image>
            <div v-else>无</div>
          </div>
        </div>
      </div>
      <div class="btnArea">
        <zy-button class="btn" @click="back">返回</zy-button>
      </div>
    </zyInfoPanel>
  </div>
</template>

<script>
	export default {
		name: "CStatisticsDetail",
		props: {},
		data() {
			return {
				type: '',
				logistics_id: '',
				statisticsInfo: [
					{
						name: "合作企业：",
						val: "",
						code: 'company_name'
					},
					{
						name: "快递类型：",
						val: "",
						code: 'logistics_type_desc'
					},
					{
						name: "快递单号：",
						val: "",
						code: 'logistics_no'
					},
					{
						name: "寄件人姓名：",
						val: "",
						code: 'post_communicate_name'
					},
					{
						name: "寄件人电话：",
						val: "",
						code: 'post_communicate_mobile'
					},
					{
						name: "寄件地址：",
						val: "",
						code: 'post_communicate_address'
					},
					{
						name: "收件人姓名：",
						val: "",
						code: 'receive_communicate_name'
					},
					{
						name: "收件人电话：",
						val: "",
						code: 'receive_communicate_mobile'
					},
					{
						name: "收件地址：",
						val: "",
						code: 'receive_communicate_address'
					},
					{
						name: "邮寄物品：",
						val: "",
						code: 'goods_name'
					},
					{
						name: "揽件时间：",
						val: "",
						code: 'post_time_desc'
					},
				],
				pictures_urls: ''
			};
		},
		computed: {},
		watch: {},
		components: {},
		methods: {
			getData() {
				this.$axios.post(this.$api.c_detailLogistics, {
					logistics_id: this.logistics_id
				}).then(res => {
					let {code, msg, data} = res;
					this.loading = false;
					if (code == 200) {
						this.statisticsInfo = this.statisticsInfo.filter(item => {
							item.val = data.info[item.code];
							return item
						});
						this.pictures_urls = data.info.face_file;
					} else {
						this.$message.error(msg);
					}
				}).catch(ret => {
					this.$message.error(ret.msg || '服务繁忙，请稍后再试');
				});
			},
			back() {
				this.$blackRoute({path: '/cooperate/statistics', that: this})
			}
		},
		mounted() {
			this.logistics_id = this.$route.query.logistics_id;
			this.getData();
		},
		created() {
		}
	}
</script>

<style scoped lang="less" src="@/style/cooperate/statistics/statisticsDetail/index.less">

</style>
